<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>历史渊源 - 河北涿州</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- 导航栏（复用） -->
  <nav class="navbar">
    <div class="container">
      <a href="index.html" class="logo">涿州印象</a>
      <ul class="nav-links">
        <li><a href="index.html">首页</a></li>
        <li><a href="history.html" class="active">历史渊源</a></li>
        <li><a href="attractions.html">景点推荐</a></li>
        <li><a href="culture.html">文化特色</a></li>
        <li><a href="food.html">美食攻略</a></li>
      </ul>
    </div>
  </nav>

  <!-- 页面标题 -->
  <header class="page-header">
    <div class="container">
      <h2>历史渊源</h2>
      <p>穿越千年的古城记忆</p>
    </div>
  </header>

  <!-- 历史内容 -->
  <section class="history-content">
    <div class="container">
      <div class="history-timeline">
        <div class="timeline-item">
          <h3>战国至秦代</h3>
          <p>战国时期为燕国之域，秦始皇统一六国后置涿县，属广阳郡，奠定涿州行政建制雏形。</p>
        </div>
        <div class="timeline-item">
          <h3>汉代至唐代</h3>
          <p>汉代涿县属幽州，三国时期曹操设范阳郡，唐代为幽州涿县，是北方军事重镇和交通要冲。</p>
        </div>
        <div class="timeline-item">
          <h3>宋元明清</h3>
          <p>宋代属燕山府路，元代称涿州路，明清时期隶属北平府、顺天府，乾隆皇帝南巡时御笔题书“天下第一州”。</p>
        </div>
        <div class="timeline-item">
          <h3>近现代</h3>
          <p>民国时期改称涿县，1986年撤县设涿州市，现为河北省直辖县级市，京津冀协同发展的重要节点。</p>
        </div>
      </div>
    </div>
  </section>

  <!-- 页脚 -->
  <footer class="footer">
    <div class="container">
      <p>&copy; 2025 河北涿州介绍网站 | 设计：HTML5+CSS3+JS</p>
    </div>
  </footer>

  <!-- JavaScript时间轴动画 -->
  <script>
    // 导航栏激活状态切换（复用主页面逻辑）
    const navLinks = document.querySelectorAll('.nav-links a');
    navLinks.forEach(link => {
      link.addEventListener('click', function(e) {
        e.preventDefault();
        navLinks.forEach(l => l.classList.remove('active'));
        this.classList.add('active');
        if (this.getAttribute('href') !== '#') {
          const targetId = this.getAttribute('href').substring(1);
          const targetSection = document.getElementById(targetId);
          if (targetSection) {
            targetSection.scrollIntoView({ behavior: 'smooth' });
          } else {
            window.location.href = this.getAttribute('href');
          }
        }
      });
    });

    // 时间轴动画（滚动触发）
    const timelineItems = document.querySelectorAll('.timeline-item');
    const observerOptions = {
      threshold: 0.5
    };

    const timelineObserver = new IntersectionObserver((entries) => {
      entries.forEach(entry => {
        if (entry.isIntersecting) {
          entry.target.style.animation = 'fadeInUp 1s ease forwards';
        }
      });
    }, observerOptions);

    timelineItems.forEach(item => {
      timelineObserver.observe(item);
    });

    // 页面加载动画
    document.addEventListener('DOMContentLoaded', function() {
      const historyContent = document.querySelector('.history-content');
      historyContent.style.opacity = '0';
      setTimeout(() => {
        historyContent.style.transition = 'opacity 1s ease';
        historyContent.style.opacity = '1';
      }, 100);
    });
  </script>
</body>
</html>